<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="bundle.js"></script>
  </head>

  <body>
    <div id="app">
      文本节点：{{ msg }}, {{ user.name}}
      <div v-if="isShow">元素节点中的文本节点：{{msg }}, {{user.name}} </div>
      <input type="text" v-model="msg">
      <input type="text" v-model="user.name">
    </div>
    <script>
      const vm = new Vue({
        el: '#app',
        data() {
          return {
            msg: 'hehe',
            isShow: true,
            user: {
              name: 'zs'
            }
          }
        },
        // watch: {
        //   msg(newValue, oldValue) {
        //     console.log('msg变了', newValue, oldValue, this.msg);
        //   },
        //   'user.name'(newValue, oldValue) {
        //     console.log('user.name变了', newValue, oldValue, this.user.name);
        //   },
        //   user(newValue, oldValue) {
        //     console.log('user变了', newValue, oldValue, this.user);
        //   },
        // }
      })
    </script>
  </body>

</html>
